Integrand size = 38, antiderivative size = 91 \[ \int \frac {A+B \sin (e+f x)}{(a+a \sin (e+f x)) \sqrt {c-c \sin (e+f x)}} \, dx=\frac {(A+B) \text {arctanh}\left (\frac {\sqrt {c} \cos (e+f x)}{\sqrt {2} \sqrt {c-c \sin (e+f x)}}\right )}{\sqrt {2} a \sqrt {c} f}-\frac {(A-B) \sec (e+f x) \sqrt {c-c \sin (e+f x)}}{a c f} \]
1/2*(A+B)*arctanh(1/2*cos(f*x+e)*c^(1/2)*2^(1/2)/(c-c*sin(f*x+e))^(1/2))/a /f*2^(1/2)/c^(1/2)-(A-B)*sec(f*x+e)*(c-c*sin(f*x+e))^(1/2)/a/c/f
Result contains complex when optimal does not.
Time = 1.35 (sec) , antiderivative size = 140, normalized size of antiderivative = 1.54 \[ \int \frac {A+B \sin (e+f x)}{(a+a \sin (e+f x)) \sqrt {c-c \sin (e+f x)}} \, dx=\frac {\left (\cos \left (\frac {1}{2} (e+f x)\right )-\sin \left (\frac {1}{2} (e+f x)\right )\right ) \left (\cos \left (\frac {1}{2} (e+f x)\right )+\sin \left (\frac {1}{2} (e+f x)\right )\right ) \left (-A+B-(1+i) \sqrt [4]{-1} (A+B) \arctan \left (\left (\frac {1}{2}+\frac {i}{2}\right ) \sqrt [4]{-1} \left (1+\tan \left (\frac {1}{4} (e+f x)\right )\right )\right ) \left (\cos \left (\frac {1}{2} (e+f x)\right )+\sin \left (\frac {1}{2} (e+f x)\right )\right )\right )}{a f (1+\sin (e+f x)) \sqrt {c-c \sin (e+f x)}} \]
((Cos[(e + f*x)/2] - Sin[(e + f*x)/2])*(Cos[(e + f*x)/2] + Sin[(e + f*x)/2 ])*(-A + B - (1 + I)*(-1)^(1/4)*(A + B)*ArcTan[(1/2 + I/2)*(-1)^(1/4)*(1 + Tan[(e + f*x)/4])]*(Cos[(e + f*x)/2] + Sin[(e + f*x)/2])))/(a*f*(1 + Sin[ e + f*x])*Sqrt[c - c*Sin[e + f*x]])
Time = 0.57 (sec) , antiderivative size = 89, normalized size of antiderivative = 0.98, number of steps used = 8, number of rules used = 7, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.184, Rules used = {3042, 3446, 3042, 3334, 3042, 3128, 219}
Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.
\(\displaystyle \int \frac {A+B \sin (e+f x)}{(a \sin (e+f x)+a) \sqrt {c-c \sin (e+f x)}} \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {A+B \sin (e+f x)}{(a \sin (e+f x)+a) \sqrt {c-c \sin (e+f x)}}dx\) |
\(\Big \downarrow \) 3446 |
\(\displaystyle \frac {\int \sec ^2(e+f x) (A+B \sin (e+f x)) \sqrt {c-c \sin (e+f x)}dx}{a c}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {\int \frac {(A+B \sin (e+f x)) \sqrt {c-c \sin (e+f x)}}{\cos (e+f x)^2}dx}{a c}\) |
\(\Big \downarrow \) 3334 |
\(\displaystyle \frac {\frac {1}{2} c (A+B) \int \frac {1}{\sqrt {c-c \sin (e+f x)}}dx-\frac {(A-B) \sec (e+f x) \sqrt {c-c \sin (e+f x)}}{f}}{a c}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {\frac {1}{2} c (A+B) \int \frac {1}{\sqrt {c-c \sin (e+f x)}}dx-\frac {(A-B) \sec (e+f x) \sqrt {c-c \sin (e+f x)}}{f}}{a c}\) |
\(\Big \downarrow \) 3128 |
\(\displaystyle \frac {-\frac {c (A+B) \int \frac {1}{2 c-\frac {c^2 \cos ^2(e+f x)}{c-c \sin (e+f x)}}d\left (-\frac {c \cos (e+f x)}{\sqrt {c-c \sin (e+f x)}}\right )}{f}-\frac {(A-B) \sec (e+f x) \sqrt {c-c \sin (e+f x)}}{f}}{a c}\) |
\(\Big \downarrow \) 219 |
\(\displaystyle \frac {\frac {\sqrt {c} (A+B) \text {arctanh}\left (\frac {\sqrt {c} \cos (e+f x)}{\sqrt {2} \sqrt {c-c \sin (e+f x)}}\right )}{\sqrt {2} f}-\frac {(A-B) \sec (e+f x) \sqrt {c-c \sin (e+f x)}}{f}}{a c}\) |
(((A + B)*Sqrt[c]*ArcTanh[(Sqrt[c]*Cos[e + f*x])/(Sqrt[2]*Sqrt[c - c*Sin[e + f*x]])])/(Sqrt[2]*f) - ((A - B)*Sec[e + f*x]*Sqrt[c - c*Sin[e + f*x]])/ f)/(a*c)
3.2.12.3.1 Defintions of rubi rules used
Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[-b, 2]))* ArcTanh[Rt[-b, 2]*(x/Rt[a, 2])], x] /; FreeQ[{a, b}, x] && NegQ[a/b] && (Gt Q[a, 0] || LtQ[b, 0])
Int[1/Sqrt[(a_) + (b_.)*sin[(c_.) + (d_.)*(x_)]], x_Symbol] :> Simp[-2/d Subst[Int[1/(2*a - x^2), x], x, b*(Cos[c + d*x]/Sqrt[a + b*Sin[c + d*x]])], x] /; FreeQ[{a, b, c, d}, x] && EqQ[a^2 - b^2, 0]
Int[(cos[(e_.) + (f_.)*(x_)]*(g_.))^(p_)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x _)])^(m_.)*((c_.) + (d_.)*sin[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[(-(b* c + a*d))*(g*Cos[e + f*x])^(p + 1)*((a + b*Sin[e + f*x])^m/(a*f*g*(p + 1))) , x] + Simp[b*((a*d*m + b*c*(m + p + 1))/(a*g^2*(p + 1))) Int[(g*Cos[e + f*x])^(p + 2)*(a + b*Sin[e + f*x])^(m - 1), x], x] /; FreeQ[{a, b, c, d, e, f, g}, x] && EqQ[a^2 - b^2, 0] && GtQ[m, -1] && LtQ[p, -1]
Int[((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)*((A_.) + (B_.)*sin[(e_.) + (f_.)*(x_)])*((c_) + (d_.)*sin[(e_.) + (f_.)*(x_)])^(n_.), x_Symbol] :> Si mp[a^m*c^m Int[Cos[e + f*x]^(2*m)*(c + d*Sin[e + f*x])^(n - m)*(A + B*Sin [e + f*x]), x], x] /; FreeQ[{a, b, c, d, e, f, A, B, n}, x] && EqQ[b*c + a* d, 0] && EqQ[a^2 - b^2, 0] && IntegerQ[m] && !(IntegerQ[n] && ((LtQ[m, 0] && GtQ[n, 0]) || LtQ[0, n, m] || LtQ[m, n, 0]))
Time = 0.88 (sec) , antiderivative size = 130, normalized size of antiderivative = 1.43
method | result | size |
default | \(-\frac {\left (\sin \left (f x +e \right )-1\right ) \left (\sqrt {2}\, \operatorname {arctanh}\left (\frac {\sqrt {c \left (1+\sin \left (f x +e \right )\right )}\, \sqrt {2}}{2 \sqrt {c}}\right ) \sqrt {c \left (1+\sin \left (f x +e \right )\right )}\, A +\sqrt {2}\, \operatorname {arctanh}\left (\frac {\sqrt {c \left (1+\sin \left (f x +e \right )\right )}\, \sqrt {2}}{2 \sqrt {c}}\right ) \sqrt {c \left (1+\sin \left (f x +e \right )\right )}\, B -2 \sqrt {c}\, A +2 \sqrt {c}\, B \right )}{2 a \sqrt {c}\, \cos \left (f x +e \right ) \sqrt {c -c \sin \left (f x +e \right )}\, f}\) | \(130\) |
-1/2/a*(sin(f*x+e)-1)*(2^(1/2)*arctanh(1/2*(c*(1+sin(f*x+e)))^(1/2)*2^(1/2 )/c^(1/2))*(c*(1+sin(f*x+e)))^(1/2)*A+2^(1/2)*arctanh(1/2*(c*(1+sin(f*x+e) ))^(1/2)*2^(1/2)/c^(1/2))*(c*(1+sin(f*x+e)))^(1/2)*B-2*c^(1/2)*A+2*c^(1/2) *B)/c^(1/2)/cos(f*x+e)/(c-c*sin(f*x+e))^(1/2)/f
Time = 0.28 (sec) , antiderivative size = 162, normalized size of antiderivative = 1.78 \[ \int \frac {A+B \sin (e+f x)}{(a+a \sin (e+f x)) \sqrt {c-c \sin (e+f x)}} \, dx=\frac {\sqrt {2} {\left (A + B\right )} \sqrt {c} \cos \left (f x + e\right ) \log \left (-\frac {\cos \left (f x + e\right )^{2} + {\left (\cos \left (f x + e\right ) - 2\right )} \sin \left (f x + e\right ) + \frac {2 \, \sqrt {2} \sqrt {-c \sin \left (f x + e\right ) + c} {\left (\cos \left (f x + e\right ) + \sin \left (f x + e\right ) + 1\right )}}{\sqrt {c}} + 3 \, \cos \left (f x + e\right ) + 2}{\cos \left (f x + e\right )^{2} + {\left (\cos \left (f x + e\right ) + 2\right )} \sin \left (f x + e\right ) - \cos \left (f x + e\right ) - 2}\right ) - 4 \, \sqrt {-c \sin \left (f x + e\right ) + c} {\left (A - B\right )}}{4 \, a c f \cos \left (f x + e\right )} \]
1/4*(sqrt(2)*(A + B)*sqrt(c)*cos(f*x + e)*log(-(cos(f*x + e)^2 + (cos(f*x + e) - 2)*sin(f*x + e) + 2*sqrt(2)*sqrt(-c*sin(f*x + e) + c)*(cos(f*x + e) + sin(f*x + e) + 1)/sqrt(c) + 3*cos(f*x + e) + 2)/(cos(f*x + e)^2 + (cos( f*x + e) + 2)*sin(f*x + e) - cos(f*x + e) - 2)) - 4*sqrt(-c*sin(f*x + e) + c)*(A - B))/(a*c*f*cos(f*x + e))
\[ \int \frac {A+B \sin (e+f x)}{(a+a \sin (e+f x)) \sqrt {c-c \sin (e+f x)}} \, dx=\frac {\int \frac {A}{\sqrt {- c \sin {\left (e + f x \right )} + c} \sin {\left (e + f x \right )} + \sqrt {- c \sin {\left (e + f x \right )} + c}}\, dx + \int \frac {B \sin {\left (e + f x \right )}}{\sqrt {- c \sin {\left (e + f x \right )} + c} \sin {\left (e + f x \right )} + \sqrt {- c \sin {\left (e + f x \right )} + c}}\, dx}{a} \]
(Integral(A/(sqrt(-c*sin(e + f*x) + c)*sin(e + f*x) + sqrt(-c*sin(e + f*x) + c)), x) + Integral(B*sin(e + f*x)/(sqrt(-c*sin(e + f*x) + c)*sin(e + f* x) + sqrt(-c*sin(e + f*x) + c)), x))/a
\[ \int \frac {A+B \sin (e+f x)}{(a+a \sin (e+f x)) \sqrt {c-c \sin (e+f x)}} \, dx=\int { \frac {B \sin \left (f x + e\right ) + A}{{\left (a \sin \left (f x + e\right ) + a\right )} \sqrt {-c \sin \left (f x + e\right ) + c}} \,d x } \]
Time = 0.35 (sec) , antiderivative size = 148, normalized size of antiderivative = 1.63 \[ \int \frac {A+B \sin (e+f x)}{(a+a \sin (e+f x)) \sqrt {c-c \sin (e+f x)}} \, dx=\frac {\frac {\sqrt {2} {\left (A \sqrt {c} + B \sqrt {c}\right )} \log \left (-\frac {\cos \left (-\frac {1}{4} \, \pi + \frac {1}{2} \, f x + \frac {1}{2} \, e\right ) - 1}{\cos \left (-\frac {1}{4} \, \pi + \frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + 1}\right )}{a c \mathrm {sgn}\left (\sin \left (-\frac {1}{4} \, \pi + \frac {1}{2} \, f x + \frac {1}{2} \, e\right )\right )} + \frac {4 \, \sqrt {2} {\left (A \sqrt {c} - B \sqrt {c}\right )}}{a c {\left (\frac {\cos \left (-\frac {1}{4} \, \pi + \frac {1}{2} \, f x + \frac {1}{2} \, e\right ) - 1}{\cos \left (-\frac {1}{4} \, \pi + \frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + 1} + 1\right )} \mathrm {sgn}\left (\sin \left (-\frac {1}{4} \, \pi + \frac {1}{2} \, f x + \frac {1}{2} \, e\right )\right )}}{4 \, f} \]
1/4*(sqrt(2)*(A*sqrt(c) + B*sqrt(c))*log(-(cos(-1/4*pi + 1/2*f*x + 1/2*e) - 1)/(cos(-1/4*pi + 1/2*f*x + 1/2*e) + 1))/(a*c*sgn(sin(-1/4*pi + 1/2*f*x + 1/2*e))) + 4*sqrt(2)*(A*sqrt(c) - B*sqrt(c))/(a*c*((cos(-1/4*pi + 1/2*f* x + 1/2*e) - 1)/(cos(-1/4*pi + 1/2*f*x + 1/2*e) + 1) + 1)*sgn(sin(-1/4*pi + 1/2*f*x + 1/2*e))))/f
Timed out. \[ \int \frac {A+B \sin (e+f x)}{(a+a \sin (e+f x)) \sqrt {c-c \sin (e+f x)}} \, dx=\int \frac {A+B\,\sin \left (e+f\,x\right )}{\left (a+a\,\sin \left (e+f\,x\right )\right )\,\sqrt {c-c\,\sin \left (e+f\,x\right )}} \,d x \]